#include "mainwindow.h"
#include <QApplication>
#include <QtSql>
#include <QSqlQuery>
#include <QMessageBox>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    QMessageBox msg;

    QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL");
    db.setHostName("127.0.0.1");
    db.setDatabaseName("jent");
    db.setUserName("postgres");
    db.setPassword("sucesso!@#");


    if(!db.open()){
        msg.setText("Erro");
        msg.exec();
    }else{
        msg.setText("Conexão aberta");
        msg.exec();
    }

    db.close();

    return a.exec();
}
